<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>05-鼠标事件</title>
    <script>
        window.onload = function () {
          // 获取div对象
          let divEle1 = document.getElementById("but1");
          let divEle2 = document.getElementById("but2");
          // 绑定事件
          // 鼠标单机事件 onclick
          divEle1.onclick = function () {
            alert("你单击我了");
          }
          // 双击事件 ondblclick
          divEle2.ondblclick = function () {
            alert("你双击我了")
          }
        }
    </script>
</head>
<body>
<div id="but1">单机我</div>
<div id="but2">双击我</div>
</body>
</html>